<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>图书管理</title>
    <jsp:include page="/abstract/base-head.jsp"></jsp:include>
    <script type="text/javascript">
        $(function () {
            $(".delBtn").click(function () {
                var td = $(this).parent().parent().children(':first');
                return confirm("您确定要删除 [" + td.text() + "] 吗?");
            });
        });
    </script>
</head>
<body>

<div id="header">
    <img class="logo_img" alt="" src="static/img/logo.gif">
    <span class="wel_word">图书管理系统</span>
    <jsp:include page="/abstract/base-manager.jsp"></jsp:include>
</div>

<div id="main">
    <table>
        <tr>
            <td>名称</td>
            <td>价格</td>
            <td>作者</td>
            <td>销量</td>
            <td>库存</td>
            <td colspan="2">操作</td>
        </tr>
        <c:forEach items="${list.items}" var="book">
            <tr>
                <td>${book.name}</td>
                <td>${book.price}</td>
                <td>${book.author}</td>
                <td>${book.sales}</td>
                <td>${book.stock}</td>
                <td><a href="book/manager?method=getOne&id=${book.id}&current_page=${list.currentPage}">修改</a></td>
                <td><a class="delBtn" href="book/manager?method=delete&id=${book.id}&current_page=${list.currentPage}">删除</a>
                </td>
            </tr>
        </c:forEach>

        <tr>
            <td></td>
            <td></td>
            <td></td>
            <td></td>
            <td></td>
            <td></td>
            <td><a href="pages/manager/book_edit.jsp">添加图书</a></td>
        </tr>
    </table>
    <jsp:include page="/abstract/base-paging.jsp"></jsp:include>
</div>

<div id="bottom">
		<span>
			尚硅谷书城.Copyright &copy;2015
		</span>
</div>
</body>
</html>